package com.bckj.fastboot.iot.datcol.mqtt.controller;

import com.bckj.fastboot.iot.datcol.mqtt.service.IotMqttService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * MqttController
 *
 * @author wfc
 **/
@RestController
@RequiredArgsConstructor
@RequestMapping("mqtt")
public class IotMqttController {

    private final IotMqttService iotMqttService;

    /**
     * 发送消息
     *
     * @param topic   topic
     * @param payload payload
     */
    @RequestMapping("publish")
    public void publish(String topic, String payload) {
        iotMqttService.publish(topic, payload);
    }
}
